﻿using System;
using System.Collections.Generic;
using System.Text;
using SanctusSoftware.Logging;

namespace SanctusSoftware.Logging.WinForms
{
    public class TransmissionLogDistributor : TextFileLogDistributor
    {

        #region Public Properties

        public string SoftwareProductName { get; set; }

        #endregion

        #region ILogDistributor Members

        public override void Distribute(string logText)
        {

            Byte[] screenCaptureBytes = ScreenCapturer.CaptureScreenToBytes();
            System.Text.ASCIIEncoding encoding = new ASCIIEncoding();
            Byte[] logTextBytes = encoding.GetBytes(logText);

            ErrorTransmissionForm f = new ErrorTransmissionForm(logTextBytes, screenCaptureBytes);
            f.SoftwareProductName = this.SoftwareProductName;
            f.ShowDialog();

        }

        #endregion

    }
}
